package com.itheima.controller;

import com.itheima.dto.Result;
import com.itheima.service.CheckgroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/checkgroup")
public class CheckgroupController {
    @Autowired
    CheckgroupService checkgroupServiceImpl;

    @DeleteMapping(value = "/{id}")
    public Result delete(@PathVariable Integer id) {
        return checkgroupServiceImpl.saveDelete(id)?
                Result.success("删除检查项成功"):
                Result.error("该检查组正在被使用，不能删除");
    }


}
